package com.iepacj.mina;

import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;

import java.nio.charset.Charset;

/**
 * mina
 */
public class MinaServer {

    public void startup2() {

        int ioProcessor = Runtime.getRuntime().availableProcessors() * 2;

        NioSocketAcceptor acceptor = new NioSocketAcceptor(ioProcessor);

        acceptor.getFilterChain().addLast("dd", null);

        acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("utf-8"))));

		System.out.println("heheheh");
    }
}
